Skip to content

fix(domain): repair the red suite and the dead repository - #6

Closed
arnaud-zg wants to merge 1 commit into
refactor/isolate-configurationfrom
fix/domain-red-suite-and-dead-repo
Closed

arnaud-zg wants to merge 1 commit into
refactor/isolate-configurationfrom
fix/domain-red-suite-and-dead-repo

Conversation

@arnaud-zg

Copy link
Copy Markdown
Owner

Stacked on #5. This is the one that turns the Test job green.

Summary

  • ShippingPolicy.spec.ts asserted a 50/5.99 threshold that stopped matching the real
    300/25 constants a while ago. Rewrote it to read the expected values off
    ShippingPolicy's own constants instead of duplicating them, so it can't drift again
  • Delete the empty, committed value-objects/__spec__/Product.spec.ts, superseded by the
    one under value-objects/Product/
  • Product.spec.ts gave beginner, adventurer, and expert the exact same ProfileDetails,
    so the level-routing logic was never actually exercised. Gave each level distinct data,
    which caught Product.getLoreLink/getVideoUrl having three branches that all
    returned the same expression
  • LocalStorageWelcomeSurveyRepository.getSurvey() could never read localStorage: its
    cache started at {survey: null} instead of unset, so the guard meant to skip a
    redundant read always won and the actual read was unreachable
  • TanstackStoreWelcomeSurvey.repository.ts touched localStorage at import time with
    no guard, which would crash under a Node server-side render, coming later in this
    stack. Guarded both accesses and added coverage proving it now imports fine without a
    DOM
flowchart LR
  A[stale spec, empty spec, dead cache branch] --> B[fixed and covered]
  C[localStorage at import time] --> D[guarded, safe under SSR]
Loading

Test plan

  • pnpm typecheck
  • pnpm check
  • pnpm build
  • pnpm test, 12 files, 70 tests, all green

🤖 Generated with Claude Code

https://claude.ai/code/session_014BcGPRc3sgUJYKihGRXh5g

- ShippingPolicy.spec.ts asserted a 50/5.99 threshold that stopped matching the real
  300/25 constants a while ago (4 failing tests). Rewrote it to read the expected values
  off ShippingPolicy's own constants instead of duplicating them, so it can't go stale
  the same way again
- delete the empty, committed value-objects/__spec__/Product.spec.ts, superseded by the
  one under value-objects/Product/
- Product.spec.ts gave beginner/adventurer/expert the exact same ProfileDetails, so the
  level-routing logic was never actually exercised. Gave each level distinct data,
  which is what caught Product.getLoreLink/getVideoUrl having three branches that all
  returned the same expression
- LocalStorageWelcomeSurveyRepository.getSurvey() could never read localStorage: cache
  was initialized to {survey: null}, so the `cache !== undefined` guard always won.
  Fixed the sentinel and added the coverage this repository never had
- TanstackStoreWelcomeSurvey.repository.ts touched localStorage at import time with no
  guard, which would crash under a Node server-side render (the prerender step lands
  later in this stack). Guarded both accesses, added a node-environment spec proving the
  module now imports and works without a DOM

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BcGPRc3sgUJYKihGRXh5g
@arnaud-zg

Copy link
Copy Markdown
Owner Author

Superseded by #17, which combines this with #2, #3, #4, #5 into one PR: modernize the toolchain and fix the pre-existing bugs, as a single mergeable unit.

@arnaud-zg arnaud-zg closed this Sep 2, 2026
@arnaud-zg
arnaud-zg deleted the fix/domain-red-suite-and-dead-repo branch September 2, 2026 19:01
@arnaud-zg
arnaud-zg restored the fix/domain-red-suite-and-dead-repo branch September 2, 2026 19:13
@arnaud-zg arnaud-zg reopened this Sep 2, 2026
@arnaud-zg

Copy link
Copy Markdown
Owner Author

Closing as stale/superseded — this branch stack's work already landed on main via a reorganized set of PRs (see #17, #7, #18, #10, #12, #13, #19, #16, #14, #20). Re-merging this branch now would conflict with / partially revert that work.

@arnaud-zg arnaud-zg closed this Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant